package it.izsto.be.bean;

import it.izsto.bo.FiltriBean;
import it.izsto.dto.sig4.SigfrmWithBLOBs;
import it.izsto.dto.sig4.VControlloAccessi;
import it.izsto.dto.sig4.giuseppe.UserLab;
import it.izsto.dto.sig4.giuseppe.UserQuery;
import it.izsto.service.GestoreIZSTOService;

import java.math.BigDecimal;
import java.util.List;

import javax.ejb.LocalBean;
import javax.ejb.Stateless;

/**
 * Session Bean implementation class HomePortaleBackingBean
 */
@Stateless(mappedName="HomePortaleBean")
@LocalBean
public class HomePortaleBackingBean implements HomePortaleBackingBeanRemote, HomePortaleBackingBeanLocal {

    /**
     * Default constructor. 
     */
    public HomePortaleBackingBean() {
        // TODO Auto-generated constructor stub
    }
    
    public List<VControlloAccessi> getRiepilogoList(FiltriBean filtri) {
    	
    	GestoreIZSTOService service = new GestoreIZSTOService();
    	return service.getRiepilogoList(filtri);
    }
    
	public SigfrmWithBLOBs getPDF(String codRapporto, String annoRapporto) {
		GestoreIZSTOService service = new GestoreIZSTOService();
		SigfrmWithBLOBs toRet = service.getPDF(codRapporto, annoRapporto);
		return toRet;
	}

	public void inserisciUtente(String newUser) throws Exception {
		GestoreIZSTOService service = new GestoreIZSTOService();
		service.inserisciUtente(newUser);
	}

	public void eliminaUtente(BigDecimal idUser) throws Exception {
		GestoreIZSTOService service = new GestoreIZSTOService();
		service.eliminaUtente(idUser);
	}

	public List<UserQuery> getqueryUtente(BigDecimal userId) {
		GestoreIZSTOService service = new GestoreIZSTOService();
		
		return service.getqueryUtente(userId);
	}

	public List<UserLab> getLaboratoriUtente(BigDecimal userId) {
		GestoreIZSTOService service = new GestoreIZSTOService();
		
		return service.getLaboratoriUtente(userId);
	}

	@Override
	public void aggiornaLab(BigDecimal userId, List<String> selectedLab) {
		GestoreIZSTOService service = new GestoreIZSTOService();
		
		service.aggiornaLab(userId, selectedLab);
		
	}

	@Override
	public void aggiornaQuery(BigDecimal userId, List<String> selectedQuery) {
		GestoreIZSTOService service = new GestoreIZSTOService();
		
		service.aggiornaQuery(userId, selectedQuery);
		
	}
}
